//
//  TableViewController.swift
//  MyWeiBlog
//
//  Created by laichunhui on 15/9/29.
//  Copyright © 2015年 lch. All rights reserved.
//

import UIKit

class TabBarControlle: UITabBarController
{
    override func viewDidLoad()
    {
        setUpAllChildViewController()
    }
    // 初始化所有子控制器
    private func setUpAllChildViewController()
    {
//        addChildVc(HomeViewController(), title: "我的Blog", imageName: "tabbar_home", selimageName: "tabbar_home_highlighted")
//        
//        addChildVc(MeViewController(), title: "我", imageName: "tabbar_profile", selimageName: "tabbar_profile_highlighted")
        
    }
    private func addChildVc(childVc:UIViewController, title:String, imageName:String, selimageName:String)
    {
        childVc.title = title
        //设置图片
        childVc.tabBarItem.image = UIImage(named: imageName)
        childVc.tabBarItem.selectedImage = UIImage(named: selimageName)
        
        let nav = NavigationController(rootViewController:childVc)
        addChildViewController(nav)
    }
}
